17. Diagnosing Performance

Diagnosing Performance

QUESTION:

Your VR project is not maintaining framerate, and you’re not sure why. Describe the steps you would take to diagnose the source of problem (including if the problem is non-obvious from looking at the profiler timeline).

ANSWER:

  1. Run the app with the profiler open and look for obvious signs of the issue, such as over 1000 draw calls, over 2 million tris, large amounts of milliseconds spent on physics or scripting.
  2. If a certain script is taking an unusual amount of time, turn on the deep profiler and investigate the script for the source of the slowdown. If physics is taking a long time check the number of physics objects in your scene, and try disabling certain ones to see if there’s a specific culprit.
  3. If the problem is still non-obvious, disable large sections of your scene and see if the performance improves. If it does, disable fewer / smaller sections until you have isolated the offending GameObjects. Also check the overdraw view to make sure that’s not causing issues.